//
//  Step.m
//  ChampoinPeso
//
//  Created by mac on 2025/2/16.
//

#import "Step.h"
#import "StepHeader.h"
#import "StepCell.h"
#import "Auth.h"

#define Step_Source @[@[@"PRC ID",@"SSS ID",@"PHILIPPINE PASSPORT",@"POSTAL ID",@"UMiD(Unifed Multi-purpose lD)"],@[@"DRIVER'S LICENSE",@"STUDENT CARD",@"TIN ID",@"Voter's ID",@"Philhealth lD"]]

@interface Step ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UIImageView *bg;
@property (nonatomic,strong)StepHeader *header;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *source;
@end

@implementation Step

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navtitleText = @"ID Type";
    UIImageView *bgIV = [[UIImageView alloc] initWithFrame:self.view.bounds];
    bgIV.image = [UIImage imageNamed:@"sbg"];
    [self.view addSubview:bgIV];
    [self navUI];
    UIView *view = [UIView new];
    [self.view addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.navView.mas_bottom).offset(94);
        make.left.mas_offset(13);
        make.right.mas_offset(-13);
        make.height.mas_equalTo(406);
    }];
    [view addSubview:self.bg];
    [_bg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.mas_offset(0);
    }];
    [view addSubview:self.header];
    [_header mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_offset(0);
        make.height.mas_equalTo(90);
    }];
    
    [view addSubview:self.tableView];
    [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_header.mas_bottom).offset(40);
        make.left.right.bottom.mas_offset(0);
    }];
}
-(NSMutableArray *)source {
    if (!_source) {
        _source = [NSMutableArray arrayWithArray:Step_Source];
    }
    return _source;
}
-(StepHeader *)header
{
    if (!_header) {
        _header = [[StepHeader alloc]initWithFrame:CGRectZero];
    }
    return _header;
}
-(UIImageView *)bg
{
    if(!_bg){
        _bg = [UIImageView new];
        _bg.image = [UIImage imageNamed:@"ssbg"];
        _bg.contentMode = UIViewContentModeScaleToFill;
    }
    return _bg;
}
-(UITableView *)tableView
{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
        _tableView.backgroundColor = UIColor.clearColor;
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView.showsHorizontalScrollIndicator = NO;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.bounces = NO;
    }
    return _tableView;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    StepCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([StepCell class])];
    if (cell == nil) {
        cell = [[StepCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([StepCell class])];
    }
    cell.backgroundColor = UIColor.clearColor;
    cell.nameStr = Step_Source[0][indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    Auth *vc = [Auth  new];
    [self.navigationController pushViewController:vc animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
